//
//  DXBluetooh.h
//  BabyBluetoothAppDemo
//
//  Created by 戴义兴 on 2017/4/5.
//  Copyright © 2017年 刘彦玮. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "BabyBluetooth.h"

@interface DXBluetooh : NSObject

@property (assign, readonly, nonatomic)BOOL writeBusy;


+ (instancetype)shareBabyBluetooth;
- (void)startBluetoothService;

-(void)scanDeviceWithMacAdress:(NSString *)macAdress
             readCharacterUUID:(NSString *)readCharacterUUID
            writeCharacterUUID:(NSString *)writeCharacterUUID
                  notifiyBlock:(void (^)(NSData * data, NSError *error))notifiyBlock
                     wtiteData:(void (^)(BOOL ready))wtiteDataBlock
               wtiteDataResult:(void (^)(NSData *value, NSError *error))wtiteDataResult
                 readRSSIBlock:(void (^)(NSNumber *RSSI, NSError *error))readRSSIBlock
   failToConnectAtChannelBlock:(void (^)(NSError *error))failToConnectAtChannelBlock
      disconnectAtChannelBlock:(void (^)(NSError *error))disconnectAtChannelBlock;

- (void)writeValueWith:(Byte *)byte lenght:(NSInteger)lenght;

// 同步时间应答
- (void)respondTimeToHardware;

// 连接状态下同步计步数据应答
- (void)respondsynStep;

// 连接状态下同步坐姿数据应答
- (void)respondsynPosture;

// 交换结束应答
- (void)respondComplete;

// 获取电池电量
- (void)getBattary;

// 激活命令
- (void)activation;

// 取消激活命令
- (void)cancelActivation;

// 连接状态下同步计步数据
- (void)synStep;

// 连接状态下同步坐姿数据
- (void)synPosture;

// 设置马达震动
- (void)setMotor:(BOOL)open shockTime:(NSInteger)shockTime;

// 读取马达震动
- (void)getMotor;

// 设置校准坐姿
- (void)setPosture;

// 重启
- (void)restart;

@end
